<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta
            name="description"
            content="便捷计算工具，包含科学计算器和单位转换器"
        />
        <link rel="icon" href="faviconlogo.ico">

        <link rel="stylesheet" href="css/calculator.css" />
        <link rel="stylesheet" href="css/styles.css" />
        <title>计算工具 - 便捷工具合集</title>

        <!-- Preconnect to CDN -->
        <link rel="preconnect" href="https://cdnjs.cloudflare.com" />
        <link
            rel="preconnect"
            href="https://cdnjs.cloudflare.com"
            crossorigin
        />

        <link rel="stylesheet" href="css/styles.css" />
        <link
            rel="stylesheet"
            href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
            integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
            crossorigin="anonymous"
            referrerpolicy="no-referrer"
        />
    </head>
    <body>
       <!-- 导航栏代码 -->
<nav class="navbar">
    <div class="logo no-wrap">
        <i class="fas fa-toolbox"></i>
        <span>便捷工具合集</span>
    </div>
    <div class="nav-container">
        <ul class="nav-links">
            <li><a href="index.html" class="nav-item no-wrap">首页</a></li>
            <li><a href="calculator.html" class="nav-item no-wrap">计算工具</a></li>
            <li><a href="image-processing.html" class="nav-item no-wrap">图像处理</a></li>
            <li><a href="dev-tools.html" class="nav-item no-wrap">开发工具</a></li>
            <li><a href="life-tools.html" class="nav-item no-wrap">生活工具</a></li>
            <li><a href="404.html" class="nav-item no-wrap">API工具</a></li>
        </ul>
        <div class="nav-actions">
            <button id="sidebarToggle" class="btn mobile-menu-btn">
                <i class="fas fa-bars no-wrap"></i>
            </button>
            <li id="userInfo" style="display: none">
                <span class="username"></span>
                <button onclick="logout()" class="btn logout-btn">
                    <i class="fas fa-sign-out-alt"></i>
                </button>
            </li>
            <li id="login">
                <a href="login.html" class="nav-item active no-wrap login-link"
                    ><i class="fas fa-sign-in-alt"></i>登录</a
                >
            </li>
        </div>
    </div>
</nav>

        <main>
            <!-- 计算器部分 -->
            <section class="section" aria-labelledby="calculator-title">
                <h2 class="section-title" id="calculator-title">
                    <i class="fas fa-calculator" aria-hidden="true"></i>
                    科学计算器
                </h2>
                <div
                    class="calculator"
                    role="application"
                    aria-label="科学计算器"
                >
                    <div class="calculator-display">
                        <label for="calcDisplay" class="sr-only"
                            >计算器显示</label
                        >
                        <input
                            type="text"
                            id="calcDisplay"
                            readonly
                            aria-live="polite"
                        />
                    </div>
                    <div class="calculator-keys">
                        <button
                            class="calc-btn operator"
                            data-value="C"
                            aria-label="清除"
                        >
                            C
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="CE"
                            aria-label="清除输入"
                        >
                            CE
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="%"
                            aria-label="百分比"
                        >
                            %
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="/"
                            aria-label="除"
                        >
                            /
                        </button>

                        <button class="calc-btn" data-value="7" aria-label="7">
                            7
                        </button>
                        <button class="calc-btn" data-value="8" aria-label="8">
                            8
                        </button>
                        <button class="calc-btn" data-value="9" aria-label="9">
                            9
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="*"
                            aria-label="乘"
                        >
                            ×
                        </button>

                        <button class="calc-btn" data-value="4" aria-label="4">
                            4
                        </button>
                        <button class="calc-btn" data-value="5" aria-label="5">
                            5
                        </button>
                        <button class="calc-btn" data-value="6" aria-label="6">
                            6
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="-"
                            aria-label="减"
                        >
                            -
                        </button>

                        <button class="calc-btn" data-value="1" aria-label="1">
                            1
                        </button>
                        <button class="calc-btn" data-value="2" aria-label="2">
                            2
                        </button>
                        <button class="calc-btn" data-value="3" aria-label="3">
                            3
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="+"
                            aria-label="加"
                        >
                            +
                        </button>

                        <button class="calc-btn" data-value="0" aria-label="0">
                            0
                        </button>
                        <button
                            class="calc-btn"
                            data-value="."
                            aria-label="小数点"
                        >
                            .
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="="
                            aria-label="等于"
                        >
                            =
                        </button>
                        <button
                            class="calc-btn operator"
                            data-value="sqrt"
                            aria-label="平方根"
                        >
                            √
                        </button>
                    </div>
                </div>
            </section>
        </main>
        <!-- 页脚 -->
     <footer>
    <div class="footer-content">
        <div class="footer-column">
            <h3>在线工具合集</h3>
            <p>提供全面实用的在线工具，助力高效完成各类任务。</p>
            <div class="social-links" style="display: flex; gap: 1rem; margin-top: 1rem">
                <a href="#" style="color: white"><i class="fab fa-facebook fa-lg"></i></a>
                <a href="#" style="color: white"><i class="fab fa-twitter fa-lg"></i></a>
                <a href="#" style="color: white"><i class="fab fa-instagram fa-lg"></i></a>
                <a href="#" style="color: white"><i class="fab fa-github fa-lg"></i></a>
            </div>
        </div>

        <div class="footer-column">
            <h3>工具分类</h3>
            <ul class="footer-links">
                <li><a href="calculator.html"><i class="fas fa-calculator"></i> 计算工具</a></li>
                <li><a href="image-processing.html"><i class="fas fa-image"></i> 图像处理</a></li>
                <li><a href="dev-tools.html"><i class="fas fa-code"></i> 开发工具</a></li>
                <li><a href="life-tools.html"><i class="fas fa-clock"></i> 生活工具</a></li>
                <li><a href="edu-tools.html"><i class="fas fa-book"></i> 教育工具</a></li>
            </ul>
        </div>

        <div class="footer-column">
            <h3>帮助中心</h3>
            <ul class="footer-links">
                <li><a href="#" ><i class="fas fa-question-circle"></i> 常见问题</a></li>
                <li><a href="#" ><i class="fas fa-play-circle"></i> 使用教程</a></li>
                <li><a href="#" ><i class="fas fa-comment"></i> 意见反馈</a></li>
                <li><a href="about.html"><i class="fas fa-envelope"></i> 联系我们</a></li>
            </ul>
        </div>

        <div class="footer-column">
            <h3>订阅更新</h3>
            <p>获取最新工具和功能更新</p>
            <div class="subscribe-form">
                <div class="input-group">
                    <input type="email" placeholder="您的邮箱" class="form-control" />
                    <button class="btn btn-primary">订阅</button>
                </div>
            </div>
        </div>
    </div>

    <div class="copyright">
        <p>&copy; 2025 在线工具合集 - 个人开发者保留所有权利</p>
    </div>
</footer>
        <script src="js/calculator.js" defer></script>
        <script src="js/common.js" defer></script>
        <script src="js/left.js"></script>
    </body>
</html>
